<template>
    <div>
        <nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top shadow">
			<a class="navbar-brand" href="#">
				<img src="../assets/img/logo.png" height="30" class="d-inline-block align-top" alt="">
				Mall电商运营平台
			</a>
			<ul class="navbar-nav mr-auto">
				<li class="nav-item">
					<a class="nav-link active" href="/dataView">数据看板</a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/productList">商品维护</a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/userList">会员管理</a>
				</li>
			</ul>
			<span class="navbar-text"><a class="nav-link " th:href='#'
                @click.prevent="getAdminInfo()"
                ><i class="fa fa-user"></i>个人中心[<span>{{ userName }}</span>]</a></span>
		</nav>
    </div>
</template>

<script lang="ts" setup name="Nav">
import "../assets/css/bootstrap.min.css";
import "../assets/css/font-awesome.css";
import { useRouter } from "vue-router";
const userName = localStorage.getItem("username");
const userId=localStorage.getItem("userId");
const userIdInt=parseInt(userId);
const router = useRouter();
const getAdminInfo = async() => {
    router.push(`/adminInfo/${userIdInt}`)
}
</script>
